<?php /* @var $this Controller */ ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <meta name="description" content="overview &amp; stats" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <!-- basic styles -->
        <link href="<?php echo Yii::app()->baseUrl."/../assets/css/bootstrap.min.css" ?>" rel="stylesheet" />	
        <link href="<?php echo Yii::app()->baseUrl."/../assets/css/font-awesome.min.css" ?>" rel="stylesheet" />
        <!-- page specific plugin styles -->
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl."/../assets/css/jquery-ui-1.10.3.full.min.css"?>" />
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl."/../assets/css/chosen.css"?>" />
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl."/../assets/css/datepicker.css"?>" />
        <link rel="stylesheet" href="<?php echo Yii::app()->baseUrl."/../assets/css/ui.jqgrid.css"?>" />
        
        <!-- ace styles -->
        <link href="<?php echo Yii::app()->baseUrl."/../assets/css/ace.min.css" ?>" rel="stylesheet" />
        <link href="<?php echo Yii::app()->baseUrl."/../assets/css/ace-rtl.min.css" ?>" rel="stylesheet" />
        <link href="<?php echo Yii::app()->baseUrl."/../assets/css/ace-skins.min.css" ?>" rel="stylesheet" />
        
        <!-- ace settings handler -->
        <script src="<?php echo Yii::app()->baseUrl."/../assets/js/ace-extra.min.js" ?>" ></script>

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>       
    </head>    
    <body>
        <?php 
            $modelSalePoint = new SalePointModel();
            $rows_salepoint = $modelSalePoint->getDatabase('all');
            $active = 0;
            foreach ($rows_salepoint as $key => $value) {
                if ($value['sale_active']) {
                    $active++;
                }
            }
            $key++;
        ?>
        <div class="navbar navbar-default" id="navbar">
            <script type="text/javascript">
                try{ace.settings.check('navbar' , 'fixed')}catch(e){}
            </script>
            <div class="navbar-container" id="navbar-container">
                <div class="navbar-header pull-left">
                    <a href="#" class="navbar-brand">
                        <small>
                            <img src="<?php echo Yii::app()->request->baseUrl; ?>/../images/logo.png" style="width: 30px; height: 30px"></img>
                            Order System
                        </small>
                    </a><!-- /.brand -->
                </div><!-- /.navbar-header -->
                <div class="navbar-header pull-right" role="navigation">
                    <ul class="nav ace-nav">                                      
                        <li class="grey">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <i class="icon-tasks"></i>
                                <span class="badge badge-grey"><?php echo $key - $active;?></span>
                            </a>                        
                            <ul class="pull-right dropdown-navbar dropdown-menu dropdown-caret dropdown-close">
                                <li class="dropdown-header">
                                    <i class="icon-ok"></i>
                                    Danh sách thương hiệu
                                </li>
                                <li>
                                    <a href="#">
                                        <div class="clearfix">
                                            <span class="pull-left">Đã hoạt động</span>
                                            <span class="pull-right">
                                                 <?php                                                  
                                                 echo $active."/".$key;
                                                 ?>
                                            </span>
                                        </div>                                   
                                        <div class="progress progress-mini ">
                                            <div style="width:<?php echo (int)($active/$key*100).'%';?>" class="progress-bar "></div>
                                        </div>
                                    </a>
                                </li>
                                <li>
                                    <a href="../site/salepoint">
                                        Chi tiết
                                        <i class="icon-arrow-right"></i>
                                    </a>
                                </li>
                            </ul>
                        </li>
                        
                        <li class="light-blue">
                            <a data-toggle="dropdown" href="#" class="dropdown-toggle">
                                <img class="nav-user-photo" src="<?php echo Yii::app()->request->baseUrl; ?>/../assets/css/images/logo.png"/>
                                <span class="user-info">
                                    <small>Welcome,</small>
		<?php echo Yii::app()->session['username_admin'];?>
                                </span>
                                <i class="icon-caret-down"></i>
                            </a>
                            <ul class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
                                <li>
                                    <a href="../site/logout">
                                        <i class="icon-off"></i>
                                        Logout
                                    </a>
                                </li>
                            </ul>
                        </li>
                    </ul><!-- /.ace-nav -->
                </div><!-- /.navbar-header -->
            </div><!-- /.container -->
        </div>    
        <div class="main-container" id="main-container">
            <script type="text/javascript">
                try{ace.settings.check('main-container' , 'fixed')}catch(e){}
            </script>
            
            <div class="main-container-inner">
                <a class="menu-toggler" id="menu-toggler" href="#">
                    <span class="menu-text"></span>
                </a>
                
                <div class="sidebar" id="sidebar">
                    <script type="text/javascript">
                        try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
                    </script>
                    <ul class="nav nav-list">
                        <li>                            
                            <a href="../../../">
                                <i class="icon-home blue"></i>
                                <span class="menu-text"> Trang Chủ </span>
                            </a>
                        </li>
                         <li>                            
                            <a href="../site/salepoint">
                                <i class="icon-bookmark blue"></i>
                                <span class="menu-text"> Thương Hiệu </span>
                            </a>
                        </li>                  
                        
                    </ul><!-- /.nav-list -->
                    
                    <div class="sidebar-collapse" id="sidebar-collapse">
                        <i class="icon-double-angle-left" data-icon1="icon-double-angle-left" data-icon2="icon-double-angle-right"></i>
                    </div>
                    <script type="text/javascript">
                        try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
                    </script>
                </div>
                
                <div class="main-content">
                 <?php echo $content; ?>
                </div><!-- /.main-content -->
                
                <div class="ace-settings-container" id="ace-settings-container">
                    <div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
                        <i class="icon-cog bigger-150"></i>
                    </div>
                    
                    <div class="ace-settings-box" id="ace-settings-box">
                        <div>
                            <div class="pull-left">
                                <select id="skin-colorpicker" class="hide">
                                    <option data-skin="default" value="#438EB9">#438EB9</option>
                                    <option data-skin="skin-1" value="#222A2D">#222A2D</option>
                                    <option data-skin="skin-2" value="#C6487E">#C6487E</option>
                                    <option data-skin="skin-3" value="#D0D0D0">#D0D0D0</option>
                                </select>
                            </div>
                            <span>&nbsp; Choose Skin</span>
                        </div>
                        
                        <div>
                            <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
                            <label class="lbl" for="ace-settings-navbar"> Fixed Navbar</label>
                        </div>
                        
                        <div>
                            <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
                            <label class="lbl" for="ace-settings-sidebar"> Fixed Sidebar</label>
                        </div>
                        
                        <div>
                            <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-breadcrumbs" />
                            <label class="lbl" for="ace-settings-breadcrumbs"> Fixed Breadcrumbs</label>
                        </div>
                        
                        <div>
                            <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-rtl" />
                            <label class="lbl" for="ace-settings-rtl"> Right To Left (rtl)</label>
                        </div>
                        
                        <div>
                            <input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
                            <label class="lbl" for="ace-settings-add-container">
                                Inside
                                <b>.container</b>
                            </label>
                        </div>
                    </div>
                </div><!-- /#ace-settings-container -->
            </div><!-- /.main-container-inner -->
            
            <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
                <i class="icon-double-angle-up icon-only bigger-110"></i>
            </a>
        </div><!-- /.main-container -->
        <script type="text/javascript" charset="utf-8">
            setTimeout(function(){
                window.location.reload(1);
            }, 300000); //reload every 5 minus
        </script>
    </body>
</html>
